#include "ComplexSample.h"

namespace Entities {

INIT_FACTORY(ComplexSample)

ComplexSample::ComplexSample(Complex<double> d){
	sample = d;
}

double & ComplexSample::real(){
	return sample.real();
}

double & ComplexSample::imag(){
	return sample.imag();
}

ObjectInputStream & ComplexSample::load(ObjectInputStream & iis){
	iis >> sample;
	return iis;
}

ObjectOutputStream & ComplexSample::save(ObjectOutputStream & oos) const{
	oos << sample;
	return oos;
}

ComplexSample conj(const ComplexSample & c){
	return ComplexSample(conj(c.sample));
}

double abs(const ComplexSample & c){
	return abs(c.sample);
}

double fabs(const ComplexSample & c){
	return fabs(c.sample);
}

double norm(const ComplexSample & c){
	return norm(c.sample);
}

double arg(const ComplexSample & c){
	return arg(c.sample);
}

ComplexSample exp(const ComplexSample & c){
	return ComplexSample(exp(c.sample));
}

ComplexSample cosh(const ComplexSample & c){
	return ComplexSample(cosh(c.sample));
}

ComplexSample sinh(const ComplexSample & c){
	return ComplexSample(sinh(c.sample));
}

ComplexSample cos(const ComplexSample & c){
	return ComplexSample(cos(c.sample));
}

ComplexSample sin(const ComplexSample & c){
	return ComplexSample(sin(c.sample));
}

ComplexSample log(const ComplexSample & c){
	return ComplexSample(log(c.sample));
}

ComplexSample pow(const ComplexSample & c1, double d){
	return ComplexSample(pow(c1.sample, d));
}

ComplexSample pow(const ComplexSample & c, int p){
	return ComplexSample(pow(c.sample, p));
}

ComplexSample sqrt(const ComplexSample & c){
	return ComplexSample(sqrt(c.sample));
}

ComplexSample log10(const ComplexSample & c){
		return ComplexSample(log10(c.sample));
}

}
